import pymongo

from pymongo import MongoClient
client = MongoClient('localhost', 27017)   # 连接数据库
db = client.all
collection=db.addressHistory1807   # 选择集合
result=collection.remove({'latitude':{'$gte':37.31,'$lte':35.21}})   # 处理纬度
result=collection.remove({'longitude':{'$gte':110.31,'$lte':107.41}})   # 处理经度
result=collection.remove({'speed':{'$gte':100,'$lte':0}})   # 车速
result=collection.remove({'isuNum':None})   # 处理空值
result=collection.remove({'latitude':None})
result=collection.remove({'longitude':None})
result=collection.remove({'speed':None})
result=collection.remove({'time':None})